package cn.abstractfactory.csl;

/**
 * Created by siyuzhiyue on 2017/6/9.
 */
public class ShapeFactory extends AbstractFactory {
    @Override
    Color getColor(String color) {
        return null;
    }

    @Override
    Shape getShape(String shape) {
        if(shape == null)
            return null;
        else if("CIRCLE".equalsIgnoreCase(shape))
            return new Circle();
        else if("RECTANGLE".equalsIgnoreCase(shape))
            return new Rectangle();
        else if("SQUARE".equalsIgnoreCase(shape))
            return new Square();
        return null;
    }
}
